/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package server_v1_0;
import java.io.*;
import java.net.*;
import java.io.Serializable;
/**
 *
 * @author suhui
 */
public class player implements Serializable{
    public int msgtype = 0;
    public String username = "";
    public String password = "";
    public String ipaddress = "";
    public int port =0;

    //for testing purposes
    public player() {
        username = "superman";
        password = "notaplane";
        ipaddress = "localhost";
    }
    //client constructor
   public player( int referencetype, String inputname, String inputpw) {
        msgtype = referencetype;
	username = inputname;
        password = inputpw;
        ipaddress = "localhost";
    }
    //server constructor
    public player(String name, String ips, int portnum){
        username = name;
        ipaddress = ips;
        port = portnum;
    }

    public void setip(InetAddress ip,int portnum)
    {
        ipaddress = ip.getHostAddress();
        port = portnum;

    }


}
